package sys_enum

// 系统-用户级别
type sysUserGrade int

var SysUserGrade sysUserGrade

// 全部
func (c *sysUserGrade) DataAccessAll() int {
	return 1
}

// 省
func (c *sysUserGrade) DataAccessProvince() int {
	return 2
}

// 市
func (c *sysUserGrade) DataAccessCity() int {
	return 3
}

// 县
func (c *sysUserGrade) DataAccessArea() int {
	return 4
}

// 组织
func (c *sysUserGrade) DataAccessOrg() int {
	return 5
}

// 部门
func (c *sysUserGrade) DataAccessDept() int {
	return 6
}

// 个人
func (c *sysUserGrade) DataAccessUser() int {
	return 7
}

func (c *sysUserGrade) ToText(value int) string {
	switch value {

	case 1:
		return "DataAccessAll"

	case 2:
		return "DataAccessProvince"

	case 3:
		return "DataAccessCity"

	case 4:
		return "DataAccessArea"

	case 5:
		return "DataAccessOrg"

	case 6:
		return "DataAccessDept"

	case 7:
		return "DataAccessUser"

	}
	return ""
}

func (c *sysUserGrade) ToValue(text string) int {
	switch text {

	case "DataAccessAll":
		return 1

	case "DataAccessProvince":
		return 2

	case "DataAccessCity":
		return 3

	case "DataAccessArea":
		return 4

	case "DataAccessOrg":
		return 5

	case "DataAccessDept":
		return 6

	case "DataAccessUser":
		return 7

	}
	return 0
}
